<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div>
            <h1 style="background-color: greenyellow;">{{message}}</h1>
            <h1 style="background-color: hotpink;">{{reversemessage}}</h1>
        </div>
        <div>
            <button @click="change">改变</button>
        </div>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            message:'helloworld'
        },
        computed: {
            reversemessage:function(){
                return this.message.split('').reverse().join('');
            }
        },
        methods: {
            change(){
                this.message="woniuxy";
            }
        },
    });

</script>